<?php

use common\modules\article\api\Article;
use yii\helpers\Html;

$this->title = 'Index';

?>

<div class="text-center">
    <h2>Last article from category #1</h2>
    <br/>
    <div class="row text-left">
        <?php $article = Article::last(1, ['category_id' => 1]); ?>
        <div class="col-md-2">
            <?php echo Html::img($article->thumb(160, 120)) ?>
        </div>
        <div class="col-md-10 text-left">
            <?php echo Html::a($article->title, ['/article/view', 'slug' => $article->slug]) ?>
            <br/>
            <?php echo $article->short ?>
        </div>
    </div>
</div>

<br/>
